package g4p.newtext;

import g4p_controls.ZStyledTextDisplay;

import java.awt.Font;

import processing.core.PApplet;

public class Test001 extends PApplet {

	ZStyledTextDisplay stda;
	String[] lines;

	int px = 20, py = 60, w = 560, h = 400;
	int ww = 560;
	Font font =  new Font("Arial", Font.PLAIN, 24);

	public void setup(){
		size(600,600);
		cursor(CROSS);
		background(200,200,255);
		lines = loadStrings("data/g4p/dummy.txt");
		fill(240);
		noStroke();
		rect(px,py,w,h);
		//GStyledTextDisplay(PApplet app, int dw, int dh, float wrapwidth, Font font) 
		stda = new ZStyledTextDisplay(this, px, py, w, h, ww, font);
		stda.setText(lines);
		frameRate(10);
	}

	public void draw(){
		background(200,200,255);
		stda.updateCaret(mouseX, mouseY);
		stda.draw(this);
	}
	
	public void mouseClicked(){
		stda.setSelection(0, 0, 2, 3, 1, 6);
	}
}
